<?php
namespace controller\login;
require_once '../model/model.php';
use admin\Model\model as m;


$login = new m();
if(!empty($_POST['name'])&&!empty($_POST['password'])){
	$username = $_POST['name'];
	$password = $_POST['password'];
	$login->login($username,$password);
}else if(!empty($_POST['type']) && $_POST['type'] == 1) {
	$a = $_POST['admin'];
	$out = $login->logout($a);
	exit(json_encode(array('url'=>$out)));
}
